package com.example.service;

import com.example.mapper.TaskMapper;
import com.example.model.Task;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class TaskService {

    private final TaskMapper taskMapper;
    @Autowired
    public TaskService(TaskMapper taskMapper){
        this.taskMapper=taskMapper;
    }
    public void addToTask(Task task){
        taskMapper.addTask(task);
    }
    public void updateTheTask(Task task){
        taskMapper.updateTask(task);
    }
    public void deleteFromTask(String taskId){
        taskMapper.deleteTask(taskId);
    }
    public List<Task> selectFromTask(String courseId){
        return taskMapper.selectTask(courseId);
    }
    public void statusChange(String taskId){
        taskMapper.changeStatus(taskId);
    }
    public void mark(int fileId,String core){
        taskMapper.markFile(fileId,core);
    }
}